<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>连续的图像边框</title>
    <link rel="stylesheet" href="../public.css">
    <style>
        .box {
            width: 300px;
            height: 100px;
            margin: 20px auto;
        }

        .frame {
            background: url(../01背景与边框/img/stone-art.jpg);
            background-size: cover;
            padding: 1em;
        }

        .frame div {
            background: white;
            padding: 1em;
        }

        .frame1 {
            padding: 1em;
            border: 1em solid transparent;
            background-image: linear-gradient(white, white),
                url(../01背景与边框/img/stone-art.jpg);
            background-clip: padding-box, border-box;
            background-size: cover;
            background-origin: border-box;
        }

        .frame2 {
            padding: 1em;
            border: 1em solid transparent;
            background: linear-gradient(white, white) padding-box,
                        repeating-linear-gradient(
                            -45deg,red 0, red 12.5%,
                            transparent 0, transparent 25%,
                            #58a 0, #58a 37.5%,
                             transparent 0, transparent 50%) 0 / 5em 5em;
        }
        @keyframes ants {
            to{
                background-position:100%;
            }
        }
        .frame3{
            padding: 1em;
            border: 1px solid transparent;
            /* background:bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment initial|inherit; */
            background: linear-gradient(white, white) padding-box,
                        repeating-linear-gradient(-45deg, black 0,black 25%,white 0 ,white 50%)0/.6em .6em;
            animation: ants 12s linear infinite;
        }
    </style>
</head>

<body>
    <div class="content">
        <h1>连续的图像边框</h1>
        <ul>
            <li>利用两个div，一个元素设置图片背景，另一个元素存放内容，设置纯白背景</li>
        </ul>
        <div class="box frame ">
            <div>
                它的原理基本上就是九宫格伸缩法：把图片切割成九块，然后把它们应用到元素边框相应的边和角。
            </div>
        </div>
    </div>
    <div class="content">
        <h1>连续的图像边框</h1>
        <ul>
            <li>在背景图片之上，在叠加一层纯白的实色背景</li>
            <li>给两层背景设置不同background-clip值</li>
        </ul>
        <div class="box frame1 ">
            它的原理基本上就是九宫格伸缩法：把图片切割成九块，然后把它们应用到元素边框相应的边和角。
        </div>
        <div class="box frame2 ">
            它的原理基本上就是九宫格伸缩法：把图片切割成九块，然后把它们应用到元素边框相应的边和角。
        </div>
        <div class="box frame3 ">
            它的原理基本上就是九宫格伸缩法：把图片切割成九块，然后把它们应用到元素边框相应的边和角。
        </div>
    </div>
</body>

</html>